package com.chanzany.flyweight;

public class Client {
    public static void main(String[] args) {
        WebSite newsSite = WebSiteFactory.getWebSite("新闻");
        newsSite.use(new WebUser("Business"));
        WebSite newsSite2 = WebSiteFactory.getWebSite("新闻");
        newsSite2.use(new WebUser("Department"));
        System.out.println(newsSite == newsSite2);

        WebSite blogSite = WebSiteFactory.getWebSite("博客");
        WebSite blogSite2 = WebSiteFactory.getWebSite("博客");
        blogSite.use(new WebUser("Customer"));
        System.out.println(blogSite==blogSite2);

        System.out.println("网站的分类个数为："+WebSiteFactory.getWebSiteCount());
    }
}
